<?php
//header("location: ".$_SERVER['HTTP_REFERER']);
header( "Content-type: text/html; charset=gbk");
header( "Expires: Mon, 26 Jul 1997 05:00:00 GMT" );
header( "Last-Modified: " . gmdate( "D, d M Y H:i:s" ) . " GMT" );
header( "Cache-Control: no-cache, must-revalidate" );
header( "Pragma: no-cache" );

?>
<?php
require_once("public.php");

echo $_SESSION['adminName']."=".$_SESSION['adminPassWord']." <br>";
//session_unregister('name'); 
unset( $_SESSION['adminName'] );
//session_unregister('password'); 
unset( $_SESSION['adminPassWord'] );
unset( $_SESSION['loginSuccessful'] );

session_destroy();
echo "ok";
$thisUrl = "logout.php";
$newUrl = substr( $_SERVER['HTTP_REFERER'] ,strlen( $_SERVER['HTTP_REFERER'] ) - strlen($thisUrl));
if( $newUrl != $thisUrl )
 redirectTo($_SERVER['HTTP_REFERER']);
else 
 redirectTo("../test.php");
?>
